package dcc.service;

import dcc.model.ProfessionalSkillInfo;
import dcc.persistence.ProfessionalSkillMapper;

public class ProfessionalSkillService extends BaseService {

	private ProfessionalSkillMapper professionalSkillMapper;

	public void setProfessionalSkillMapper(
			ProfessionalSkillMapper professionalSkillMapper) {
		this.professionalSkillMapper = professionalSkillMapper;
	}

	public ProfessionalSkillService() {
		super(ProfessionalSkillService.class);
	}

	public void save(ProfessionalSkillInfo professionalSkillInfo) {
		if (professionalSkillInfo.getId() == 0) {
			insert(professionalSkillInfo);
		} else {
			update(professionalSkillInfo);
		}
	}

	private void insert(ProfessionalSkillInfo professionalSkillInfo) {
		professionalSkillMapper.insert(professionalSkillInfo);
	}

	private void update(ProfessionalSkillInfo professionalSkillInfo) {
		professionalSkillMapper.update(professionalSkillInfo);
	}

	public ProfessionalSkillInfo getProfessionalSkillInfoByBaseId(int baseId) {
		return professionalSkillMapper.getProfessionalSkillInfoByBaseId(baseId);
	}

}
